package com.example.mobile2021606144ywr0616;


import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

import androidx.annotation.Nullable;

public class MySQLiteOpenHelper extends SQLiteOpenHelper {
    public MySQLiteOpenHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super( context, name, factory, version );
    }

    @Override
    public void onCreate(SQLiteDatabase db) {

        String sql="CREATE TABLE CarPeccancy(_id integer primary key autoincrement,carnumber varchar(20) not null,pcode varchar,pdatetime varchar,paddr varchar)";
        db.execSQL( sql );
        String sql1="CREATE TABLE Sense(_id integer primary key autoincrement,Co2 integer,pm25 integer,LightIntensity integer,hunidity integer,temperature integer )";
        db.execSQL( sql1 );
        String sql2="CREATE TABLE CarInfor(_id integer primary key autoincrement,carnumber varchar,number varchar,pcardid varchar,buydata varchar,carbrand varchar)";
        db.execSQL( sql2 );





    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
